package com.thinkit.bigdata.web.service.bus;

import com.thinkit.bigdata.core.feature.orm.mybatis.Page;
import com.thinkit.bigdata.web.model.bus.BusWorkExample;
import com.thinkit.bigdata.web.model.bus.BusWorkWithBLOBs;
import com.thinkit.bigdata.web.model.result.HtmlResult;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 *
 * Created by hccl on 2018/9/17.
 */
public interface BusWorkService {
    BusWorkWithBLOBs selectByPrimaryKey(Long id);

    List<BusWorkWithBLOBs> selectByExample(Page<BusWorkWithBLOBs> page, BusWorkExample example);

    List<BusWorkWithBLOBs> selectByExample(BusWorkExample example);

    int updateByPrimaryKey(BusWorkWithBLOBs record);

    List<Map<String, Object>> selectWorkInfos(Page page, Map<String,Object> paramsMap);

    List<Map<String, Object>> selectWorkInfos(Map<String,Object> paramsMap);

    List<BusWorkWithBLOBs> selectByCode(String code);

    BusWorkWithBLOBs getTaskByModelId(Long modelId);

    HtmlResult getTaskExpiryDateByDelete(HttpServletRequest request);

    /**
     * 获取当前日期距离可删除日期还有多少天
     * @param id - 任务id
     * @return - 距离天数，正数：距离天数，0：可删除的第一天，负数：删除的第“结果绝对值”天
     */
    int getTaskExpiryDateNum(Long id);

    HtmlResult insertSelective(HttpServletRequest request);

    HtmlResult deleteByPrimaryKey(String id);

    HtmlResult updateByPrimaryKeySelective(HttpServletRequest request);

    HtmlResult startTask(HttpServletRequest request) throws IOException;
}
